from tasktracker.models import Category, Task, TimeLog
from django.contrib import admin
    
class CategoryAdmin(admin.ModelAdmin):
    fields = ['code', 'description']
    list_display = ('code', 'description')
    search_fields = ['descritpion']

class TaskAdmin(admin.ModelAdmin):
    fields = ['description', 'category', 'status', 'opened', 'closed']
    search_fields = ['descritpion']
    list_display = ('description', 'category', 'status', 'opened', 'closed')
    list_filter = ('category', 'status',)

class TimeLogAdmin(admin.ModelAdmin):
    fields = ['task', 'start', 'end', 'status']
    search_fields = ['task']
    list_display = ('task', 'start', 'end', 'status')


admin.site.register(Category, CategoryAdmin)
admin.site.register(Task, TaskAdmin)
admin.site.register(TimeLog, TimeLogAdmin)

